document.addEventListener('DOMContentLoaded', function() {
    // 角色选择
    const roleOptions = document.querySelectorAll('.role-option');
    const selectedRole = document.getElementById('selectedRole');

    roleOptions.forEach(option => {
        option.addEventListener('click', function() {
            // 移除所有active类
            roleOptions.forEach(opt => {
                opt.classList.remove('active');
            });

            // 给当前选项添加active类
            this.classList.add('active');

            // 更新隐藏字段的值
            selectedRole.value = this.getAttribute('data-role');
        });
    });
});